param (
    [string]$User="",
    [string]$User_pwd="",
    [string]$MailboxName=""
)

$DATA_BACKUP_AGENT_HOME = (Get-ChildItem env:DATA_BACKUP_AGENT_HOME).Value
$Location = $DATA_BACKUP_AGENT_HOME + "\DataBackup\ProtectClient\Plugins\GeneralDBPlugin\bin\applications\exchange\ps1_scripts"
Set-Location -Path $Location
[string]$common_file_path = (Get-Location).Path + "\Common.ps1"
[string]$pssession_name = "IsMailboxExisted"

# 引用Common.ps1
. $common_file_path

if (!(NewConnection $User $User_Pwd $pssession_name)) {
    return $False
}

Invoke-Command -Session $Session -ScriptBlock {Get-Mailbox -Identity $using:MailboxName} | Out-Null
$result = $?
ClosePSSession $pssession_name
return $result
